<template>
	<view>
		<view class="nav">
			<view class="nav-one">
				<p style="width: 30%;">委托时间:</p>
				<p>金额</p>
				<p>状态</p>
				
			</view>
			<view class="nav-two" v-for="(item,index) in JSONdate" :key="index">
				<p style="width: 30%;">{{ item.create_date | timing}}</p>
				 <p>{{item.amount}}</p>
				 <p v-if="item.state==0">待审核</p>
				 <p v-if="item.state==1">成功</p>
				 <p v-if="item.state==2">失败</p>
				 <p v-if="item.state==3">审核不通过</p>
				 <p v-if="item.state==4">预下单</p>
				 <p v-if="item.state==5">已提交</p>
			</view>
		</view>
	</view>
</template>
<script>
	import moment from "moment";
	import request from '@/utils/request';
	import { mapState, mapGetters } from 'vuex';
	export default {
		data() {
			return {
				JSONdate:[]
			};
		 },
		 computed: {
		 	...mapState('user', ['userinfo'])
		 },
		 created() {
		 	this.Historical()
		 },
		 filters:{
			 timing(val) {
			 	return moment(val).format('YYYY-MM-DD HH:mm:ss');
			 },
		 },
		 methods:{
			 Historical() {
			 	let that = this;
			 	request('/deposits/record/getlist', 'POST', {
			 		guid: '001',
			 		loginId: that.userinfo.Customer.loginId,
			 		sessionId: that.userinfo.SessionId,
			 		skip:1,
					pagesize:1000
			 	}).then(res => {
			 		console.log(res.data, 67676767);
			 		if (res.data.ResultCD == 'I001') {
			 			that.JSONdate = res.data.DepositList;
			 		}
			 		try{
			 			that.JSONdate = JSON.parse(res.data).DepositList;
			 		}catch(e){
			 			//TODO handle the exception
			 			that.JSONdate = res.data.DepositList;
			 		}
			 	});
			 }
		 }
		}
</script>
<style lang="scss" scoped>
	.nav {
		width: 90%;
		margin: 0 auto;
		padding-top: 40upx;
		.nav-one {
			
			display: flex;
			justify-content: space-between;
			text-align: left;
			border-bottom: 1upx solid #F0F1F4;
			padding-bottom: 20upx;
			align-items: center;
			font-size:30upx;
			font-family:PingFang SC;
			font-weight:bold;
			color:rgba(42,47,68,1);
			
		}
		.nav-two {
			display: flex;
			justify-content: space-between;
			text-align: left;
			border-bottom: 1upx solid #F0F1F4;
			padding-bottom: 20upx;
			align-items: center;
			font-size:24upx;
			font-family:Roboto;
			font-weight:400;
			color:#999999;
			
		}
	}
	
</style>